package creational.builder;

/**
 * @Description: 建造者模式指挥者
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class Director {
    private AbstractBuilder builder;

    public Director(AbstractBuilder builder) {
        this.builder = builder;
    }

    public Director build(String from, String to, String data) {
        builder.buildFrom(from);
        builder.buildTo(to);
        builder.buildData(data);
        return this;
    }


    public void send() {
        builder.send();
    }
}
